function RequestUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if(r != null) return decodeURIComponent(r[2]);
	return null;
}

//获取现在时间
function getNowFormat() {
	var date = new Date();
	var seperator1 = "-";
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var strDate = date.getDate();
	if(month >= 1 && month <= 9) {
		month = "0" + month;
	}
	if(strDate >= 0 && strDate <= 9) {
		strDate = "0" + strDate;
	}
	var currentdate = year + seperator1 + month + seperator1 + strDate;
	return currentdate;
}

function getNowFormat2() {
	var date = new Date();
	var seperator1 = "-";
	var year = date.getFullYear();
	var month = date.getMonth() + 1;
	var strDate = date.getDate();
	if(month >= 1 && month <= 9) {
		month = "0" + month;
	}
	if(strDate >= 0 && strDate <= 9) {
		strDate = "0" + strDate;
	}
	var currentdate = year + seperator1 + month + seperator1 + strDate + " " + date.getHours() +
		":" + date.getMinutes() + ":" + date.getSeconds();
	return currentdate;
}

function S4() {
	return(((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);
}

function CreatUid() {
	return(S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4());
}

function endWith(str, endStr) {
	var d = str.length - endStr.length;
	return(d >= 0 && str.lastIndexOf(endStr) == d)
}

function IsImage(ur) {
	var urkzm = ur.substring(ur.lastIndexOf("."), ur.length);
	urkzm = urkzm.toLowerCase();

	if(urkzm == '.gif' || urkzm == ".bmp" || urkzm == ".jpeg" || urkzm == ".png" || urkzm == ".ico" || urkzm == ".jpg" || urkzm == ".wmf" || urkzm == ".jpeg" || urkzm == ".emf") {
		return true;
	} else
		return false;
}